/**
 * Created by hehe on 2015/7/21.
 */
var BaseParser = require('./BaseParser').BaseParser;

function HandFilledParser(option) {
    this.filePath = option.filePath;
}
HandFilledParser.prototype = new BaseParser(this);

//    this.constructor.prototype.verifyData();
HandFilledParser.prototype.parserToOrder = function (batchID, arr) {
    var self = this;
    if (!arr[3] || arr[3] == '' || arr[3] == undefined || isNaN(arr[5])) {
        return undefined;
    }

    var order = new Object();
    order.batchID = batchID;
    order.placeOrderTime = self.parseDate(arr[0]);
    order.channelCompanyName = arr[1];
    order.channelsOrderNo = arr[2];
    order.expressRecipient = arr[3];
    order.expressRecipientTel = arr[4];
    order.deviceQuantity = parseInt(arr[5]);
    order.leaseBeginTime = self.parseDate(arr[6]);
    order.receiveAddress = arr[8];
    order.leaseDayNumber = arr[10];
    order.leaseEndTime = self.parseDate(arr[11]);
    order.restitutionAddress = arr[12];
    order.orderReamk1 = arr[13];
    order.foregitStatus = arr[14];
    order.sn;
    order.foregift;
    order.takeAwayTime = self.parseDate(arr[7]+","+arr[9]);

    order.processingMode;
    order.rentMachineOrderNo;
    order.orderStatus;
    order.orderReamk2;
    order.orderReamk3;
    order.orderReamk4;
    order.cancelDescription;
    order.sku;
    order.deviceType;
    order.paymentMehtod;
    order.destination;
    order.unitPrice;
    order.expectedRent;
    order.actualRent;
    order.totalRent;
    order.exWareHouseTime;
    order.renewal;
    order.renewalTime;
    order.accounts;
    order.skyroamID;
    order.channelNo;
    order.deliveryWay;
    order.deliveryPlace;
    order.orderAirport;
    order.expressCompany;
    order.expressPickUpTime;
    order.expressNo;
    order.expressServiceTime;
    order.currency;
    order.checkedStatus;
    order.processingModel
    order.deductForegift;
    order.deductForegiftDescription;
    order.dedcutForegitftTime;
    return order;
}


exports.HandFilledParser = HandFilledParser;
